{% extends "user-base.html" %}
{% block titile %}
    修改信息
{% endblock %}

{% load staticfiles %}

{% block content %}
    <div class="content"
         style="width:75%;float: inside;height: 900px;margin-top:85px;margin-left: 270px;font-size: 20px">
        <form name="user_s" id="data" action="{% url 'user:modifyuserinfo' %}" method="post"
              onsubmit="return validateForm()">{% csrf_token %}
            <div class="Account"
                 style="z-index: 100;float: left;margin-left:10%;margin-top: 10%;height: 250px;width: 400px;">
                <h3 style="font-size: 35px;text-align: center">Account</h3>
                <h5 style="margin-top:20px;">账&nbsp&nbsp户:&nbsp&nbsp&nbsp<label><input id="username_per"
                                                                                       name="username_per"
                                                                                       value="{{ user.username }}"
                                                                                       type="text" class="account"
                                                                                       placeholder="" readonly
                                                                                       unselectable="on"></label></h5>
                <h5 style="margin-top:20px;">昵&nbsp&nbsp称:&nbsp&nbsp&nbsp<input name="nickname" id="nickname"
                                                                                value="{{ user.nick_name }}" type="text"
                                                                                style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;"
                                                                                class="name" placeholder="输入昵称"></h5>
                <h5 style="margin-top:20px;">性&nbsp&nbsp别:&nbsp&nbsp&nbsp<input name="gender" id="gender"
                                                                                value="{{ user.gender }}" type="sex"
                                                                                style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;"
                                                                                class="sex" placeholder="输入性别 男/女"
                                                                                maxlength="1"></h5>
                <h5 style="margin-top:20px;">电&nbsp&nbsp话:&nbsp&nbsp&nbsp<input name="mobile" type="text" id="mobile"
                                                                                value="{{ user.mobile }}" class="number"
                                                                                style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;"
                                                                                placeholder="请输入联系电话<必填字段>"
                                                                                maxlength="11"></h5>
                <h5 style="margin-top:20px;">地&nbsp&nbsp址:&nbsp&nbsp&nbsp<input name="address" id="address"
                                                                                value="{{ user.address }}" type="text"
                                                                                style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;"
                                                                                class="address" placeholder="请输入地址">
                </h5>

            </div>
            <hr size=450px width="1" color="#999999" style="display:inline-block;float: left;margin-left: 100px" ;>
            <div class="Trading"
                 style="z-index: 100;float: left;margin-left:10%;margin-top: 10%;height: 250px;width: 400px;">
                <h3 style="font-size: 35px;text-align: center; ">Trading_Account</h3>
                <h5 style="margin-top:45px;"><p style="margin-left:20px;display: inline-block;">*</p>
                    BrokerID:&nbsp&nbsp&nbsp<input id="brokerid" name="brokerid"
                                                   value="{{ user.brokerID }}" type="text"
                                                   placeholder="请输入BrokerID<必填字段>" minlength="2"
                                                   style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;">
                </h5>
                <h5 style="margin-top:45px;"><p style="margin-left:20px;display: inline-block">*</p>
                    UserID:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input id="userid" name="userid"
                                                                value="{{ user.userID }}" type="text"
                                                                placeholder="请输入userID<必填字段>"
                                                                minlength="4"
                                                                style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;">
                </h5>
                <h5 style="margin-top:45px;"><p style="margin-left:20px;display: inline-block">*</p>Password:
                    <input name="paaswordtrader" type="password" value="{{ user.password_trader }}"
                           placeholder="请输入密码<必填字段>"
                           style="border:1px solid rgb(154, 153, 151);height: 40px;width: 200px;"
                           id="pass" maxlength="16" class="pass">
                    <label class="" onclick="change()" style="margin-top:20px;"><img width="30px" height="20px"
                                                                                     src="{% static 'images/eye.png' %}"></label>
                </h5>
            </div>
            <div style="width: 100%;height: 50px;float: left;text-align: center;margin-top:15%">
                <div onkeydown="keyLogin();" style="z-index: 100;display:inline-block;margin: 0 auto">
                    <input type="submit" id="new" class="new" value="更新信息" style="margin-top: 10px;margin-bottom: 50px;height: 50px;width: 300px;border-radius: 50px;
                border: 1px solid rgb(154, 153, 151);background-color:rgb(0, 120, 215);color: aliceblue;font-size: 20px;">
                    &nbsp&nbsp&nbsp&nbsp
                    <label style="color: red">{{ msg }}</label>
                </div>
            </div>
        </form>
    </div>
{% endblock %}
{% block custom_js %}
    <script src="http://apps.bdimg.com/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="{% static 'js/modifyuserinfo.js' %}"></script>
    <script>
        var isValue =
        {{ num }}
        if (isValue) {
            if (location.href.indexOf("#reloaded") == -1) {
                location.href = location.href + "#reloaded";
                location.reload();
            }
        } else {
            alert("更新失败！")
        }
    </script>
{% endblock %}